package info.ask4research.model.addons;

import info.ask4research.model.enums.QuestionsDefine;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@DiscriminatorValue("MULTIPLECHOICE")
@JsonAutoDetect
public class MultipleChoice extends Addon implements Addons{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7371465846830439615L;

	@Column(name="numberOfQuestions")
	private int numberOfQuestions;
	@Column(name="numberOfPossibleAnswers")
	private int numberOfPossibleAnswers;
	@Column(name="QuestionsDefine")
	private QuestionsDefine questionsDefine ;
	@LazyCollection(LazyCollectionOption.FALSE)
	@OneToMany
	@JoinColumn(name="multiplechoice_ID", referencedColumnName="addon_ID")
	private List<Question> questions = new ArrayList<Question>();
	
	public int getNumberOfQuestions() {
		return numberOfQuestions;
	}
	public void setNumberOfQuestions(int numberOfQuestions) {
		this.numberOfQuestions = numberOfQuestions;
	}
	public List<Question> getQuestions() {
		return questions;
	}
	public void setQuestions(List<Question> questions) {
		this.questions = questions;
	}
	public QuestionsDefine getQuestionsDefine() {
		return questionsDefine;
	}
	public void setQuestionsDefine(QuestionsDefine questionsDefine) {
		this.questionsDefine = questionsDefine;
	}
	public int getNumberOfPossibleAnswers() {
		return numberOfPossibleAnswers;
	}
	public void setNumberOfPossibleAnswers(int numberOfPossibleAnswers) {
		this.numberOfPossibleAnswers = numberOfPossibleAnswers;
	}
}
